
local MainScene = class("MainScene", cc.load("mvc").ViewBase)

function MainScene:onCreate()
    local map = cc.TMXTiledMap:create("map00.tmx")
	-- local map = cc.TMXTiledMap:create("map01.tmx")
    self:addChild(map)

    local bgLayer = map:getLayer("background")
    local tile = bgLayer:getTileAt(cc.p(1, 2)) --获取指定位置瓦片
    bgLayer:removeChild(tile, true)  --移除瓦片
    
    local coinArray = map:getObjectGroup("coin"):getObjects()
    for _, value in pairs(coinArray) do
        local coinSprite = display.newSprite("coin.png")
        coinSprite:move(value.x, value.y)
        coinSprite:addTo(self)
    end
end

return MainScene
